package ar.com.quickmart.classes;

import android.graphics.Color;

public enum PurchaseState {

	CONFIRMADA("Confirmada", Color.parseColor("#FF8000")),
	ARMANDO("Armando", Color.BLUE),
	POR_COBRAR("Por cobrar", Color.RED),
	FINALIZADA("Finalizada", Color.parseColor("#008000"));
	
	private String mStatus;
	private int mColor;
	
	private PurchaseState(String name, int color) {
		this.mStatus = name;
		this.mColor = color;
	}
	
	public int getColorId() {
		return mColor;		
	}
	
	public String getStatus() {
		return mStatus;
	}
	
	public static int getColorIdByString(String stateString) {
		for(PurchaseState state : values()) {
			if(state.getStatus().compareTo(stateString) == 0) {
				return state.getColorId();
			}
		}
		return Color.BLACK;
	}
}
